package web.common.core.message;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.validator.constraints.Range;
import web.common.core.validation.group.SearchGroup;

import javax.validation.constraints.Min;

/**
 * @author Jin Zheng
 * @since 1.0 2022-01-21
 */
@Getter
@Setter
@NoArgsConstructor
public class PageRequest {

	@Min(groups = {SearchGroup.class}, value = 1, message = "分页号从1开始")
	private int pageIndex;

	@Range(groups = {SearchGroup.class}, min = 1, max = 1000, message = "每页记录数是1-1000之间")
	private int pageSize;

}
